//
//  XJComposeBtn.swift
//  新浪微博
//
//  Created by 徐绩 on 16/4/25.
//  Copyright © 2016年 ayumi. All rights reserved.
//

import UIKit

class XJComposeBtn: UIButton {
    
   /// 重写按钮的highlighted方法
   override var highlighted: Bool {
        get{
        
            return false
        }
        set{
        
        }
    
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    private func setupUI() {
        
        imageView?.contentMode = .Center
        titleLabel?.textAlignment = .Center
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.imageView?.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.width)
        self.titleLabel?.frame = CGRectMake(0, self.frame.size.width, self.frame.size.width, self.frame.size.height - self.frame.size.width)
    }

}
